<?php
class Tools{


    //输出
    public static function dd($data)
    {
        $data = is_string($data) ? $data : json_encode($data,JSON_UNESCAPED_UNICODE);
        $time = date('Y-m-d H:i:s');
        echo "[$time]$data".PHP_EOL;
    }

    //获取一个验证码
    public static function getCode($bit = 6): string
    {
        $code = "";
        for ($i = 1; $i <= 6; $i ++){
            $code .= mt_rand(0,9);
        }
        return $code;
    }
}


